<script>
	export default {
		onLaunch: function(e) {
			console.log('-------'+window.location.search);
			
			let url = window.location.search;
			let tmpParas = GetRequestParameters(url);
			console.log('------'+JSON.stringify(tmpParas))
			var userId = tmpParas["userName"];//提取参数
			uni.setStorageSync('complain_userId',userId);
			console.log('==='+uni.getStorageSync('complain_userId'))
			
			var path = tmpParas["complainPath"];//提取参数
			console.log('==='+path)
			if (path == 'complainList') {
				uni.reLaunch({
				    url:'pages/index/complainRecordList?userId='+userId
				});
			}
			
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		
	}
	export const GetRequestParameters=(locationsearch) =>{
		let url = locationsearch;  
		let theRequest = new Object();  
		if (url.indexOf("?") != -1) {  
		    let str = url.substr(1);  
		    let strs = str.split("&");  
		    for (let i = 0; i < strs.length; i++) {  
		        theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1]);  
		    }  
		}  
		return theRequest;  
	}
		
</script>

<style>
	/*每个页面公共css */
	@import "colorui/main.css";
	@import "colorui/icon.css";
	@import "colorui/animation.css";
</style>
